package com.icekrvams.air.versionchecker

import com.google.gson.annotations.SerializedName
import java.lang.StringBuilder

/*{
    "int_versioncode": 101,
    "str_versionname": "1.0.1",
    "str_upgrade_invitation": "There is a new version.You are recommended to download it from
    Play Store by clicking the \"ok\" button.But you can also choose to ignore it this time by clicking the back button or something like that.",
    "str_whatsnew": "1.New features\n2.Bug fixes",
    "boolean_compulsory_upgrading": false
}*/
data class VersionInfo(
    @SerializedName("boolean_compulsory_upgrading")
    val isCompulsoryUpgrading: Boolean,
    @SerializedName("int_versioncode")
    val intVersioncode: Int,
    @SerializedName("str_versionname")
    val strVersionName: String,
    @SerializedName("str_whatsnew")
    val strWhatsNew: String,
    @SerializedName("str_upgrade_invitation")
    val strUpgradeInvitation: String,
) {
    override fun toString(): String {
        val sb = StringBuilder()
        sb.append("isCompulsoryUpgrading:$isCompulsoryUpgrading\n")
        sb.append("intVersioncode:$intVersioncode\n")
        sb.append("strVersionName:$strVersionName\n")
        sb.append("strWhatsNew:$strWhatsNew\n")
        sb.append("strUpgradeInvitation:$strUpgradeInvitation\n")
        return sb.toString()
    }
}